package com.yf1706.dao.jpa;


import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import com.yf1706.bean.EmpFamilyInfo;

public interface IEmpFamilyInfoJDAO extends CrudRepository<EmpFamilyInfo, Integer>{
	public EmpFamilyInfo findById(int id);
	
	//根据员工编号查找员工的家庭关系对象集合
	@Query("select efi from EmpFamilyInfo efi inner join RelationshipSetting rs "
			+ "on efi.relationshipSetting.relationshipId=rs.relationshipId "
			+ "where efi.emp.empId=:empId")
	public List<EmpFamilyInfo> findByEmpId(@Param("empId")int empId);
}
